home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
web
/
noweb
/
contrib
/
leew
/
strhack.nw
(
.txt
)
< prev
Wrap
LaTeX Document
|
1995-02-24
|
954b
|
28 lines
\documentstyle[11pt,noweb]{article}
\noweboptions{longchunks,noidentxref,smallcode}
\pagestyle{noweb}
\def\noweb/{{\tt noweb}}
\title{A Hack for Typesetting Strings in \noweb/\thanks{This
code is hereby placed in the public domain.}}
\author{Lee Wittenberg\\Kean College of New Jersey\\Union, NJ
07083\\\tt leew@pilot.njin.net}
\begin{document}
\maketitle
The following macros adjust things so that \noweb/ will use
``visible spaces'' in double-quoted strings within code chunks.
The same effect can be
achieved for single-quoted strings by replacing each occurrence
of `[["]]', below, with `[[']]'.
It doesn't work within \verb"[["~\ldots~\verb"]]" (although I
can't figure out why).
<<*>>=
\global\let\xsetup=\setupcode
\bgroup
\catcode`\"=\active\gdef\setupcode{\xsetup
\catcode`\"=\active\def"##1"{\char`\"\xxx{##1}\char`\"}}%
\egroup
\bgroup
\catcode`\ =\active\gdef\xxx#1{{\catcode`\ =\active\chardef ='40#1}}%
\egroup
\end{document}